<lv-treetable [lvData]="data" #lvTable [lvPaginator]="page">
  <thead>
  <tr>
    <th lvCellKey="name">Name</th>
    <th lvCellKey="age">Age</th>
    <th lvCellKey="random">Random</th>
  </tr>
  </thead>
  <tbody>
  <ng-container *ngTemplateOutlet="bodyContentTpl; context: { $implicit: lvTable.renderData, level: 0 }"></ng-container>

  <!-- template -->
  <ng-template #bodyContentTpl let-data let-level="level">
    <ng-container *ngFor="let item of data">
      <tr>
        <td [lvShowExpanded]="item.children?.length" [(lvExpanded)]="item.expanded" [lvPaddingLeft]="level * 24 + 'px'">
          {{ item.data.name }}
        </td>
        <td>{{ item.data.age }}</td>
        <td>{{ item.data.random }}</td>
      </tr>
      <ng-container *ngIf="item.expanded && item.children?.length">
        <ng-container *ngTemplateOutlet="bodyContentTpl; context: { $implicit: item.children, level: level + 1 }"></ng-container>
      </ng-container>
    </ng-container>
  </ng-template>
  </tbody>
</lv-treetable>
<lv-paginator #page lvPageSize="5"></lv-paginator>
